import React, { memo } from 'react'
import style from './index.module.scss'
import { useNavigate } from 'react-router'
const Index:React.FC = memo( () => {
  const navigate = useNavigate()
  const img = localStorage.getItem('img')
  const username = localStorage.getItem('username')
  return (
    <div>
        <div className={style.top}>
              <div className={style.img} onClick={()=>{
                navigate('/login')
                localStorage.removeItem('username')
                localStorage.removeItem('img')
              }}>
                <img style={{ width:'4rem',height:'4rem',borderRadius:'50%' }} src={img} alt="" />
              </div>
              <div className={style.wen}>
                 <span>{username}</span>
              </div>
        </div>
    </div>
  )
})

export default Index
